<template>
  <common-list-tabs>
    <common-tabs slot="tabs" v-model="page">
      <el-tab-pane label="密码策略" name="pass"> </el-tab-pane>
      <el-tab-pane label="登录策略" name="login"> </el-tab-pane>
      <el-tab-pane label="访问时间策略" name="timep"> </el-tab-pane>
      <el-tab-pane label="访问来源策略" name="fromp" v-if="isFromp">
      </el-tab-pane>
    </common-tabs>
    <div slot="content" class="safe-content-wrap">
      <component :is="page" @itemclick="getList"></component>
    </div>
  </common-list-tabs>
</template>

<script>
import pass from "./pass";
import login from "./login";
import timep from "./time";
import fromp from "./from";
import { loginrule_querySystemLoginRulePageList } from "@/api/management/configure/index.js";
export default {
  components: { pass, login, timep, fromp },
  props: {},
  data() {
    return { page: "pass", isFromp: false };
  },
  watch: {},
  computed: {},
  methods: {
    getList() {
      loginrule_querySystemLoginRulePageList({
        pageNum: 1,
        pageSize: 10,
      }).then((res) => {
        console.log(123);
        if (res && res.code === 200) {
          this.isFromp = res.rows[0].userLoginIpFlag == 0 ? true : false;
        }
      });
    },
  },
  created() {},
  mounted() {
    this.getList();
  },
};
</script>
<style lang="scss" scoped>
.safe-content-wrap {
  width: 100%;
  height: 100%;
}
</style>
